/*************************************************
* Title：TinyToolKit
* Author：Opportunity 
* Describe：
* CreateTime：2021-07-30 14:32:33
* Version：1.0
* Modify Recorder：
*************************************************/
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ScrollSelectPanel : MonoBehaviour
{
    public ScrollSelect scrollSelect;
    
    public void OnPageChanged(int index)
    {
        //Debug.Log(index);
        List<ScrollPageItem> pageItems = scrollSelect.PageItems;
        for (int i = 0; i < pageItems.Count; i++)
        {
            if (pageItems[i].pageIndex == index)
            {
                pageItems[i].transform.localScale = 1.2f * Vector3.one;
                pageItems[i].GetComponent<Image>().color = Color.white;
            }
            else
            {
                pageItems[i].transform.localScale = Vector3.one;
                pageItems[i].GetComponent<Image>().color = new Color(1,1,1,0.6f);
            }
        }
    }
}
